;;; An animated window LUI object

(in-package :xlui)

;(import '(lui::native-window lui::native-view lui::delegate lui::native-string))
(asdf:oos 'asdf:load-op :cl-who)

(defmacro slui (s-expression)
  `(let* ((*read-eval* t)
          (cl-who:*html-empty-tag-aware-p* nil))
     (read-from-string
      (cl-who:with-html-output-to-string
          (s nil :indent t)
        ,s-expression))))

(defclass animated-application-window (application-window)
  ())


(defmethod start-window-animation ((self animated-application-window) named-view)
  (let* ((created (ccl:make-semaphore))
	 (window (lui::native-window self))
	 (view (lui::native-view (view-named self named-view))))
    (ccl:process-run-function (format nil "Animation thread for window ~d"
				  (#/windowNumber window))
			      #'lui::animate-window
			      (ccl:%inc-ptr window 0)
			      view
			      created)
    (ccl:wait-on-semaphore created)))